﻿using System;
using System.Windows.Data;
using System.Windows.Media;

namespace BizControl.Presentation.ActivityEditModule.Converters
{
  public class MarkIsActiveToBrushConverter : IValueConverter
  {
    public MarkIsActiveToBrushConverter()
    {
      CompletedBrush = Brushes.Green;
      NotCompletedBrush = Brushes.Red;
    }

    public Brush CompletedBrush { get; set; }
    public Brush NotCompletedBrush { get; set; }

    #region IValueConverter Members

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      if (bool.Parse(value.ToString()))
        return CompletedBrush;
      return NotCompletedBrush;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      return null;
    }

    #endregion
  }
}
